<?php

namespace app\api\validate;

use think\Validate;

class RoomCheck extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'site_id'    => 'number',
        'card_number'   => 'require|number',
        'cardzimage'    => 'require',
        'cardfimage'    => 'require',
        'room_number'   => 'require',
        'room_info'     => 'require'
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'site_id.int'           => '站点ID',
        'card_number.require'   => '身份账号不可为空',
        'card_number.number'    => '身份账号格式不正确',
        'cardzimage.require'    => '身份证正面不可为空',
        'cardfimage.require'    => '身份证反面不可为空',
        'room_number.require'   => '房间号不可为空',
        'room_info.require'     => '房产信息不可为空'
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['site_id','card_number','cardzimage','cardfimage','room_number','room_info'],
        'siteCheck' => ['card_number','cardzimage','cardfimage','room_info'],
        'edit' => ['site_id','card_number','cardzimage','cardfimage','room_number','room_info'],
    ];
    
}
